#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>

class QGridLayout;
class QLineEdit;
class QPushButton;
class QRegExpValidator;
class QDBusVariant;

#define BTN_SIZE    65

class KeyBoard : public QDialog
{
    Q_OBJECT

public:
    explicit KeyBoard(QWidget *parent = 0);
    ~KeyBoard();

public:
    void initWidgets();

public slots:
    void clickButton(int index);
    void showKeyboard(QPoint pt, QRect focusWidget);
    void hideKeyboard();
    bool isVisible() const;
    void pressKey(int key);

signals:
    void commit(QString str);
    void keyboardHide();
    void SendkeyEvent(QEvent* event);

private:
    QPushButton *numBt[10];
    QPushButton *dotBt;
    QPushButton *minusBt;
    QPushButton *backspaceBt;
    QPushButton *enterBt;
    QPushButton *leftBt;
    QPushButton *rightBt;
//    QLineEdit *inputEdit;

    QRect screenRect;   //屏幕尺寸大小

    void setStyle(QString topColor, QString bottomColor, QString borderColor, QString textColor);
};

#endif // DIALOG_H
